package groovypublish

class Post {

    static hasMany = [comments:Comment]
	static belongsTo = [author:Author]
	
    String title
    String content
	Date dateCreated
    Date lastUpdated
    Boolean published = false
    SortedSet comments
	
	static constraints = {
        title(nullable:false, blank:false, length:1..50)
        author(length:0..100)
        content(nullable:false, blank:false)
        lastUpdated(nullable:true)
        published(nullable:false)
    }
}
